import { IsBoolean, IsOptional, IsString, IsUrl, MaxLength } from 'class-validator'
import { Limits } from '@boticord/consts'
import { IsOptionalString } from '@boticord/common/is-optional-string.decorator'

export class PremiumBotDto {
  @IsOptional()
  @IsBoolean()
  declare active?: boolean

  @IsOptionalString()
  @IsString()
  @IsUrl({
    host_whitelist: [ 'cdn.discordapp.com', 'media.discordapp.net' ],
    require_host: true,
    require_protocol: true,
    protocols: [ 'https' ],
  })
  @MaxLength(Limits.MaxSocialLinkLength)
  declare bannerURL?: string

  @IsOptionalString()
  @IsString()
  @IsUrl({
    host_whitelist: [ 'cdn.discordapp.com', 'media.discordapp.net' ],
    require_host: true,
    require_protocol: true,
    protocols: [ 'https' ],
  })
  @MaxLength(Limits.MaxSocialLinkLength)
  declare splashURL?: string

  @IsOptional()
  @IsBoolean()
  declare autoFetch?: boolean
}